Jump to content

  •  

Bug Tracker Migration

June 3rd
Good news everyone! The staff has decided that it is time to slowly kill off this Bug Tracker. We will begin the process of slowly migrating from this Bug Tracker over to our Github Issues which can be found here: https://github.com/HerculesWS/Hercules/issues

Over the next couple of days, I will be closing off any opportunity to create new reports. However, I still will keep the opportunity to reply to existing Bug Reports. Doing this will allow us to slowly fix any bug reports we have listed here so that we can easily migrate over to our Issue Tracker.

Update - June 7th 2015: Creating new bug posts has been disabled. Please use our https://github.com/HerculesWS/Hercules/issues tracker to post bugs. Users are still able to reply to existing bug posts.

- Administration

Issue Information

  • #005410

  • 2 - Fair

  • Confirmed

Issue Confirmations

  • Yes (3)No (0)
Photo

Moving across multiple map servers is a one way ticket with loads of errors

Posted by Hercules Bot on 09 March 2012 - 11:18 AM

Originally posted by Mr. No One
Hello!

We're experimenting with running multiple map servers for load balancing. I made two maps, one only loaded by MS1, and the other by MS2, so I can travel between the servers. When I log in, it takes me to the primary map server (MS1). I can use @warp to go to MS2, but once there, I can not come back. If I make MS1 unreachable, char server logs me in to MS2, where the situation is exactly the same, only reversed. I can go to MS1, but can not come back. Therefore it should not be a config issue, since both map servers can transfer me to each other (once).

The list of issues with a scenario of traveling from MS1 to MS2, and then back to MS1:

1) With @warp: One way ticket from both directions
- The client says a map not found error, although the map server console shows nothing.

2) With npc, warp command: One way ticket from both directions
- Map server throws handled error: [Error]: buildin_warp: moving player 'xyz' to "transfer_01",49,49 failed.
- Map server sometimes throws unhanded pointer exceptions:
[Error]: Memory manager: args of aFree 0x0x10e247cc is invalid pointer script.c line 2831
[2012.03.09 11:53:55][Error]: Memory manager: args of aFree 0x0x111333b4 is invalid pointer script.c line 2833
[2012.03.09 11:53:55][Error]: Memory manager: args of aFree 0x0x10ebc224 is invalid pointer script.c line 2834
[2012.03.09 11:53:55][Error]: Memory manager: args of aFree 0x0xf2ef62c is invalid pointer script.c line 2836
- Map server may even crash, happened to me about 1 in 5 tries.

The only way to reset this state was a restart.

Does the map get somehow removed from map_index when it's on a remote server?

Originally posted by Gepard
Map that are not present on the map-server, but are on other map-server, as marked as such. Thus, every map is marked as either:
  • available locally
  • available on other map-server
  • unavailable
Unfortunately, multi map-server support is broken. There are many issues and many bugreports about it. It needs a general review and bugfixing.

Originally posted by Mr. No One
Thanks for the quick response. Please allow me to ask one more question :)

Is there any chance that you or someone sees the challenge in this issue and will take up soon? Or should I completely forget about it?

I'd gladly offer any possible help to get this running again.

Originally posted by Gepard
This feature is rarely used, that's why it was never properly maintained, and that's why so many unreported bugs accumulated over time.

I could start fixing multi map-server support next week, and you could help simply by checking if fixes work and reporting any issues found with mms setup.

Originally posted by Mr. No One
Thank you very much, you are a hero :) Feel free to contact me if you need some feedback or help!

Originally posted by Gepard
I have tested it with two map-servers and following setup:

Map-server #1:
  • commented out map:geffen from conf/maps_athena.conf
Map-server #2:
  • uses a copy of map_athena.conf with different port (map_athena2.conf) and different maps_athena.conf with just one map:geffen (maps_athena2.conf, imported in map_athena2.conf)
  • map-server is run with map-server_sql --map-config conf/map_athena2.conf
I was unable to reproduce this issue. I could freely move between map-servers with atcommands like @go and @warp.

Originally posted by Mr. No One
I worked with duplicated folders and changed the following:
  • Both: Added transfer_01 and transfer_02 to map_index.txt
  • MS1: added transfer_01 to maps_athena.conf
  • MS2: added transfer_02 to maps_athena.conf + changed port
All other maps were still loaded, so with this setup it'd be more of a High Availability solution than a Load Balancing one.

---

Anyways, I tried to do it from one folder as you did.

I duplicated map_athena.conf as map2_athena.conf and changed these
  • import: conf/maps_athena.conf > import: conf/maps2_athena.conf
  • import: conf/import/map_conf.txt > import: conf/import/map2_conf.txt


Also duplicated those two files with the new names.
maps2_athena.conf contains only one line (without quotes, ofc): "map: geffen".
import/map2_conf.txt contains usual stuff like userid and passwd, char_ip, map_ip, a different map_port, plus "map: transfer_02"
  • MS1 loads, the maps are online, works fine.
  • MS2 started with ./map-server_sql --map-config conf/map2_athena.conf
  • MS2 loads 2 map, char server shows that its okay.

But its now completely one-way from MS1 to MS2. MS2 can not warp to any maps except the 2 loaded by itself. That's probably because I misconfigured something, since it works for you.. If you can spot something in my setup, please let me know. It now doesn't work even with duplicated folders. The only thing I did since last time was an svn update.

In the next days I'll run a few more tries and report back if anything happens. Until that, I'll gladly receive tips with the issue.

Edited by Mr. No One, 13 March 2012 - 08:05 PM.


Originally posted by Gepard
I enabled etc_log in conf/battle/misc.conf and noticed something weird:

[Status]: Received maps from 192.168.1.1:5121 (30 maps)
but it should be 805.

It looks like only first 30 maps are "seen" from another map-server. I couldn't @warp back to some newer maps, like dicastes01.

Originally posted by Gepard
# 1 fixed in [rev=15686].

Originally posted by Mr. No One
You are awesome, works (almost) perfectly!

I can warp between MSs smoothly, except with the npc I made. That still throws exceptions.

[2012.03.13 23:36:23][Error]: Memory manager: args of aFree 0x0x10d1cd14 is invalid pointer script.c line 2831
[2012.03.13 23:36:23][Error]: Memory manager: args of aFree 0x0x110e03b4 is invalid pointer script.c line 2833
[2012.03.13 23:36:23][Error]: Memory manager: args of aFree 0x0x10dd14f4 is invalid pointer script.c line 2834
[2012.03.13 23:36:23][Error]: Memory manager: args of aFree 0x0xf2c03cc is invalid pointer script.c line 2836


The npc contains nothing special, just a switch-select + case & warp combo.

Oh! And really-really thanks for the parametered startup tip, it made the whole thing extremely easy :)

Originally posted by Gepard
This is caused by script stack being removed from memory in wrong moment. Basically, every script that moves player to another map-server can cause crashes because of that bug.

I'll try to fix it as well.

Originally posted by Mr. No One
Hey, I found something! I truly don't mean to annoy you, hope you still have patience :)

I planned an npc which would have to operate with character transfers via MSs, even vending, auto trading players. When I warp someone with a shop, the shop is gone on the other end. But when I warp someone who is auto trading, the player does not even appear on the other side, but stays online in the database.

Is it possible to keep (re-open?) the shops somehow? :( I hope so!

But even if not, the second phenomenon may still be called a bug.

Originally posted by Brian
I think that happens because when you warp to a map on another map-server, the "changing map-servers" operation is like logging out of map-server1 and logging into map-server2.

For example, you'll notice buffs are removed and reapplied.

Originally posted by Mr. No One
Yeah, that sounds logical. I haven't paid attention to the buffs to be honest, but since its another process which can even be on a remote server, I couldn't think of other methods to accomplish that :) Probably a lot of stuff like that I haven't thought about will be seen if the system will be online :)

The one million dollar question is whether this can be implemented to the "framework" that handles it without too much trouble, or not..? :)

Originally posted by Gepard

When I warp someone with a shop, the shop is gone on the other end. But when I warp someone who is auto trading, the player does not even appear on the other side, but stays online in the database.Is it possible to keep (re-open?) the shops somehow? :( I hope so!But even if not, the second phenomenon may still be called a bug.

If you warp someone autotrading, they never show up, because there is no client attached to send LoadEndAck (a packet that tells server that client is done loading map from GRF). The character is stuck in between maps until relog.